<?php

namespace app\common\model;

use think\Model;

/**
 * 会员余额日志模型
 */
class MoneyLog Extends Model
{

    // 表名
    protected $name = 'user_money_log';
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = '';
    // 追加属性
    protected $append = [
    ];

    public function add_money_log($user_id,$money,$before,$after,$memo,$type=1){
        $this->user_id = $user_id;
        $this->money = $money;
        $this->before = $before;
        $this->after = $after;
        $this->memo = $memo;
        $this->type = $type;
        $this->save();
        return true;
    }
}
